package main

import (
	"encoding/json"
	"fmt"
)

func studentScore() {
	data := `
{
    "张三":{
        "数学":99,
        "语文":65,
        "物理":78,
        "化学":52,
        "生物":40
    },
    "李四":{
        "数学":56,
        "语文":45,
        "物理":66,
        "化学":99,
        "生物":99
    },
    "王五":{
        "数学":55,
        "语文":77,
        "物理":90,
        "化学":80,
        "生物":89
    },
    "夏六":{
        "数学":32,
        "语文":55,
        "物理":77,
        "化学":98,
        "生物":98
    }
}
`
	var (
		m   map[string]map[string]int
		err error
		res = make(map[string]int, 6)
	)

	if err = json.Unmarshal([]byte(data), &m); nil != err {
		panic(err)
	}

	for _, v := range m {
		for k1, v1 := range v {
			if v2, ok := res[k1]; ok {
				if v1 > v2 {
					res[k1] = v1
				}
			} else {
				res[k1] = v1
			}
		}
	}
	fmt.Println(res)
}

type weiaiStaffInfo struct {
	ID           int    `json:"staff_id"`
	Name         string `json:"name"`
	Account      string `json:"account"`
	DepartmentId int    `json:"department_id"`
	CCStaffId    int    `json:"-"`
}

func accountJson() {
	var weiaiStaffMapping = map[int64]weiaiStaffInfo{
		763: {
			ID:           391588,
			Name:         "孟金帅",
			Account:      "331016",
			DepartmentId: 0,
			CCStaffId:    181967,
		},
		863: {
			ID:           392188,
			Name:         "王山峰",
			Account:      "331021",
			DepartmentId: 0,
			CCStaffId:    182558,
		},
		810: {
			ID:           391586,
			Name:         "杨润倩",
			Account:      "331014",
			DepartmentId: 0,
			CCStaffId:    181965,
		},
		792: {
			ID:           391582,
			Name:         "付然",
			Account:      "331011",
			DepartmentId: 0,
			CCStaffId:    181962,
		},
		862: {
			ID:           392189,
			Name:         "何向平",
			Account:      "331022",
			DepartmentId: 0,
			CCStaffId:    182559,
		},
		341: {
			ID:           391565,
			Name:         "冯世泽",
			Account:      "331004",
			DepartmentId: 1004,
			CCStaffId:    181955,
		},
		791: {
			ID:           391589,
			Name:         "段国庆",
			Account:      "331017",
			DepartmentId: 0,
			CCStaffId:    181968,
		},
		725: {
			ID:           391602,
			Name:         "莫富城",
			Account:      "331020",
			DepartmentId: 0,
			CCStaffId:    181971,
		},
		859: {
			ID:           391575,
			Name:         "冯乔斌",
			Account:      "331007",
			DepartmentId: 0,
			CCStaffId:    181958,
		},
		858: {
			ID:           391576,
			Name:         "陈玉瑶",
			Account:      "331008",
			DepartmentId: 0,
			CCStaffId:    181959,
		},
		770: {
			ID:           391585,
			Name:         "李飞燕",
			Account:      "331013",
			DepartmentId: 0,
			CCStaffId:    181964,
		},
		848: {
			ID:           391566,
			Name:         "朱跃斌",
			Account:      "331005",
			DepartmentId: 1005,
			CCStaffId:    181956,
		},
		825: {
			ID:           391584,
			Name:         "孙金叶",
			Account:      "331012",
			DepartmentId: 0,
			CCStaffId:    181963,
		},
		19: {
			ID:           391541,
			Name:         "李正驰",
			Account:      "331001",
			DepartmentId: 995,
			CCStaffId:    181952,
		},
		835: {
			ID:           391578,
			Name:         "王晋成",
			Account:      "331010",
			DepartmentId: 0,
			CCStaffId:    181961,
		},
		797: {
			ID:           391587,
			Name:         "彭春蕾",
			Account:      "331015",
			DepartmentId: 0,
			CCStaffId:    181966,
		},
		800: {
			ID:           391591,
			Name:         "张强",
			Account:      "331019",
			DepartmentId: 0,
			CCStaffId:    181970,
		},
		836: {
			ID:           391577,
			Name:         "李京沅",
			Account:      "331009",
			DepartmentId: 0,
			CCStaffId:    181960,
		},
		18: {
			ID:           391574,
			Name:         "周雅",
			Account:      "331006",
			DepartmentId: 1006,
			CCStaffId:    181957,
		},
		803: {
			ID:           391590,
			Name:         "刘亚娜",
			Account:      "331018",
			DepartmentId: 0,
			CCStaffId:    181969,
		},
		853: {
			ID:           392254,
			Name:         "邢台-王书芳",
			Account:      "331024",
			DepartmentId: 0,
			CCStaffId:    182618,
		},
		852: {
			ID:           392255,
			Name:         "邢台-杨静华",
			Account:      "331025",
			DepartmentId: 0,
			CCStaffId:    182619,
		},
		838: {
			ID:           392256,
			Name:         "邢台-武振培",
			Account:      "331026",
			DepartmentId: 0,
			CCStaffId:    182620,
		},
		839: {
			ID:           392257,
			Name:         "邢台-张风香",
			Account:      "331027",
			DepartmentId: 0,
			CCStaffId:    182621,
		},
		837: {
			ID:           392258,
			Name:         "邢台-刘彩霞",
			Account:      "331028",
			DepartmentId: 0,
			CCStaffId:    182622,
		},
		861: {
			ID:           392244,
			Name:         "王静",
			Account:      "331023",
			DepartmentId: 0,
			CCStaffId:    182609,
		},
		860: {
			ID:           392259,
			Name:         "刘晓艺",
			Account:      "331029",
			DepartmentId: 0,
			CCStaffId:    182612,
		},
		849: {
			ID:           392260,
			Name:         "邢台-王姗梓",
			Account:      "331030",
			DepartmentId: 0,
			CCStaffId:    182613,
		},
		850: {
			ID:           392261,
			Name:         "邢台-胡艳雯",
			Account:      "331031",
			DepartmentId: 0,
			CCStaffId:    182614,
		},
		851: {
			ID:           392262,
			Name:         "邢台-李学波",
			Account:      "331032",
			DepartmentId: 0,
			CCStaffId:    182615,
		},
		854: {
			ID:           392263,
			Name:         "邢台-王圆圆",
			Account:      "331033",
			DepartmentId: 0,
			CCStaffId:    182616,
		},
		855: {
			ID:           392264,
			Name:         "邢台-魏笑",
			Account:      "331034",
			DepartmentId: 0,
			CCStaffId:    182617,
		},
	}
	data, err := json.MarshalIndent(weiaiStaffMapping, "", " ")
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println(string(data))
}

func main() {
	a := 10
	fmt.Println(a)
	b := "sunshicheng"
	fmt.Println(b)

	c, d, e := 5, 5, 5
	fmt.Println(c, d, e)
	var f, g int
	f = 11
	g = 12
	fmt.Println(f, g)

	var h, i, j = 21, 22, 23
	fmt.Println(h, i, j)
	studentScore()
	fmt.Println("===== >>> ")
	accountJson()
}
